package com.vencent.spring.java.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.DeclareParents;
import org.springframework.stereotype.Component;

import com.vencent.spring.java.service.ExtraPlay;
import com.vencent.spring.java.service.OwnPlay;
import com.vencent.spring.java.service.impl.ExtraPlayImpl;
import com.vencent.spring.java.service.impl.OwnPlayImpl;

/**
 * 引入
 * 本意：给一个类增加新的方法通过代理，
 * 拓展可以变相实现多继承的功能
 * @author 1d
 *
 */
@Component
@Aspect
public class IntroductionAop {
	
	/**
	 * value 子类，要拓展的类
	 * defaultImpl 父类的实现类
	 * 静态属性 父类接口
	 */
	@DeclareParents(value="com.vencent.spring.java.service.Play+", defaultImpl=ExtraPlayImpl.class)
	public static ExtraPlay extraPlay;
	
	@DeclareParents(value="com.vencent.spring.java.service.Play+", defaultImpl=OwnPlayImpl.class)
	public static OwnPlay ownPlay;
}
